import xlrd


def read_excel(file_path):
    # 打开Excel文件
    workbook = xlrd.open_workbook(file_path)
    # 获取第一个工作表
    worksheet = workbook.sheet_by_index(0)

    # 存储所有行的数值
    all_rows = []

    # 获取表头
    headers = [header.replace(" ", "") for header in worksheet.row_values(0)]

    # 遍历行
    for row in range(1, worksheet.nrows):
        # 读取一行中每个单元格的值
        row_values = worksheet.row_values(row)
        # 将每一行的数据组合成字典
        row_dict = {headers[i]: row_values[i] for i in range(len(headers))}
        all_rows.append(row_dict)

    return all_rows
